
package com.tools.cleanmaster.ui.card.viewholder;

import android.app.Activity;
import android.view.View;

import com.google.android.gms.ads.AdView;
import com.tools.ad.EntranceType;
import com.tools.ad.ui.crad.view.AmBannerCardView;
import com.tools.cleanmaster.ui.card.ACardItem;

public class AdCardViewHolder extends ACardViewHolder {

    @Override
    public View initView(Activity activity, ACardItem card, int pos, EntranceType entrance) {
        View mCardView = entrance.getAdScene().getAdView();
        if (mCardView == null) {
            mItemView = new View(activity);
        } else {
            mItemView = mCardView;
        }

        //admob banner view
        if (mItemView instanceof AdView) {
            AmBannerCardView amBannerCardView = new AmBannerCardView(activity.getApplicationContext());
            amBannerCardView.addAdView(mItemView);
            mItemView = amBannerCardView;
        }

        return mItemView;
    }
}

